﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="QuotesUC.ascx.cs" Inherits="ERP.PageUC.QuotesUC" %>
<!-------------Show-Dữ-Liệu-------------->
<script>
    //***********************************************************
    $('.test').keyup(function (event) {
        var keycode = (event.keyCode ? event.keyCode : event.which);
        if (keycode == '13') {
            alert('You pressed a "enter" key in textbox');
        }
    });
    //***********************************************************

    $(document).ready(function () {
        PopupUpdate('#baogia_themsanpham');
    });
    function InsertRows() {
        var checkinsert1 = ($('#<%=ListViewProvision.ClientID %>' + '_txtThemDieuKhoan'));
        var checkinsert2 = ($('#<%=ListViewProvision.ClientID %>' + '_txtThemNoiDungDieuKhoan'));
        if (checkinsert1.val() != '' && checkinsert2.val() != '') {
            $('.insertclick').click();
            return true;
        }
        return false;
    };
    function CheckSaveQuotes() {
        var kt1 = $('#<%=txtMaBaoGia.ClientID %>');
        var kt2 = $('#<%=drKhachHang.ClientID %>');
        var kt3 = $('#<%=drLoaiTien.ClientID %>');
        var allFields = $([]).add(kt1).add(kt2).add(kt3);
        var valid;
        allFields.removeClass("ui-state-error");
        valid = checkLength(kt1, "Mã báo giá", 1, 50);
        valid = valid && checkdr(kt2, "khách hàng");
        valid = valid && checkdr(kt3, "loại tiền");
        if (valid) {
            updateTips('');
            allFields.removeClass("ui-state-error");
        }
        return valid;
    }
</script>
<asp:UpdatePanel ID="upDateAll" runat="server">
        <ContentTemplate>
            <!---------------Toolbar---------------->
            <div class="toolbar-main">
                    <asp:LinkButton id="btnAdd" runat="server" class="btn btn-default btn-sm" title="Thêm mới" OnClick="btnAdd_Click" ><span class="glyphicon glyphicon-pencil"></span>Thêm mới</asp:LinkButton>
                    <asp:LinkButton ID="btnDelete" CssClass="btn btn-default btn-sm" title="Xóa" runat="server" OnClientClick="return confirmCheckIn(this)" OnClick="btnDelete_Click"><span class="glyphicon glyphicon-trash"></span> Xoá</asp:LinkButton>
                    <asp:LinkButton ID="btnExcel" CssClass="btn btn-default btn-sm" title="In" runat="server"><span class="glyphicon glyphicon-print"></span> In</asp:LinkButton>
            </div>
            <!---------------Toolbar---------------->
            <%=StrAlert %>
            <!----------------Loading---------------->
            <asp:UpdateProgress ID="upDateProcess" runat="server" AssociatedUpdatePanelID="upDateAll">
                <ProgressTemplate>
                    <span style="text-align: center" class="label label-warning">Đang tải...</span>
                </ProgressTemplate>
            </asp:UpdateProgress>
            <!--------------Kêt-thúc----------------->
            <!-------------Hiễn-Dữ-Liệu-------------->
            <div class="table-responsive">
                <asp:ListView ID="ListViewAll" runat="server" DataKeyNames="Quotes_Id" OnItemCommand="ListViewAll_ItemCommand">
                    <LayoutTemplate>
                        <table id="MyTableQuotes" class="tablesorter">
                            <thead>
                                <tr>
                                    <th style="text-align: center" data-sorter="false" data-filter="false">STT</th>
                                    <th style="text-align: center" data-sorter="false" data-filter="false">
                                        <input type="checkbox" onchange="checkAll()" id="chkAll" />
                                    </th>
                                    <th style="text-align: center" class="filter-select" data-placeholder="--Chọn ngày báo giá--">Ngày báo giá</th>
                                    <th style="text-align: center" class="filter-select" data-placeholder="--Chọn số báo giá--">Số báo giá</th>
                                    <th style="text-align: center">Mã khách hàng</th>
                                    <th style="text-align: center">Tên khách hàng</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr id="itemPlaceholder" runat="server">
                                </tr>
                            </tbody>
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <tr runat="server" class="warning" ondblclick="EditRows($(this))">
                            <td style="text-align: center"><%# Eval("Quotes_Id") %></td>
                            <td style="text-align: center">
                                <asp:CheckBox ClientIDMode="Static" ID="chkList" runat="server" />
                            </td>
                            <td><%# Eval("Quotes_Time","{0:dd/MM/yyyy}") %></td>
                            <td><%# Eval("Quotes_No") %></td>
                            <td style="display:none"><%# Eval("Customer_ID") %></td>
                            <td><%# Eval("Customer_Alias") %></td>
                            <td><%# Eval("Customer_Name") %></td>
                            <td style="text-align: center; display:none;">
                                <asp:Label ID="lbIDDetail" runat ="server" Text='<%# Eval("Quotes_Id") %>'></asp:Label>
                                    <asp:Button ID="Detail" CssClass="btn btn-default btn-sm btn-xs editclick" runat="server" Text="Thay đổi" CommandName="_ViewDetail"/>
                                </td>
                        </tr>
                    </ItemTemplate>
                    <EmptyDataTemplate>
                        <div class='alert alert-danger'>
                            <a href='#' class='close' data-dismiss='alert'>&times;</a>
                            Không tìm thấy mẫu tin nào !
                        </div>
                    </EmptyDataTemplate>
                </asp:ListView>
                <div class="pager pagerMyTableQuotes">
                    <div class="toolbar-main">
                    <asp:LinkButton ID="btnReload" CssClass="btn btn-default btn-xs glyphicon glyphicon glyphicon-retweet" title="Tải lại" runat="server" OnClick="btnReload_Click"></asp:LinkButton>
                    &nbsp;
                    <asp:TextBox ID="txtSearch" CssClass="textbox-search" runat="server" />
                    <asp:LinkButton ID="btnSearch" CssClass="btn btn-default btn-xs glyphicon glyphicon glyphicon-search" title="Tìm kiếm" runat="server" OnClick="btnSearch_Click"></asp:LinkButton>
                    &nbsp;             
                    <span>Trang</span>
                        <select class="gotoPage" title="Select page number"></select>
                        <img src="../Content/TableSort/addons/pager/icons/first.png" class="first" alt="First" />
                        <img src="../Content/TableSort/addons/pager/icons/prev.png" class="prev" alt="Prev" />
                        <span class="pagedisplay"></span>
                        <img src="../Content/TableSort/addons/pager/icons/next.png" class="next" alt="Next" />
                        <img src="../Content/TableSort/addons/pager/icons/last.png" class="last" alt="Last" />
                    </div>
                </div>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnReload" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
<!--------------Kêt-thúc----------------->

<!-------------Edit-Dữ-Liệu-------------->
<div id="baogia" title="Cập nhật báo giá">
    <asp:UpdatePanel ID="upNewUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
        <ContentTemplate>
            <div class="btn-toolbar">
                <asp:LinkButton ID="btnSavePopup" data-placement="bottom" class="btn btn-default btn-sm" title="Lưu lại" runat="server" OnClientClick="return CheckSaveQuotes();" OnClick="btnSavePopup_Click"><span class="glyphicon glyphicon-floppy-disk"></span> Lưu lại</asp:LinkButton>
                &nbsp;
            <asp:LinkButton ID="btnReloadPopup" data-placement="bottom" class="btn btn-default btn-sm" title="Tải lại" runat="server" OnClick="btnReloadPopup_Click"><span class="glyphicon glyphicon-retweet"></span> Tải lại</asp:LinkButton>
                &nbsp;
             <asp:LinkButton ID="btnAdd_Quotes_Product" data-placement="bottom" class="btn btn-default btn-sm" title="Thêm sản phẩm" runat="server" OnClick="btnAdd_Quotes_Product_Click"><span class="glyphicon glyphicon-pencil"></span> Thêm sản phẩm</asp:LinkButton>
                <input type="hidden" id="lbID" runat="server" /><label class="validateTips"></label>
                <asp:UpdateProgress ID="upDateProcessUC" runat="server" AssociatedUpdatePanelID="upNewUpdatePanel">
                    <ProgressTemplate>
                        <span class="label label-warning">Đang tải..</span>
                    </ProgressTemplate>
                </asp:UpdateProgress>
            </div>
            <div class="ui-main" style="width: 925px;">
                <div class="ui-box" style="text-align: center">
                    <asp:TextBox ID="txtTieuDe" TextMode="MultiLine" Style="text-align: center; height: 30px;" CssClass="textbox-muiti" runat="server" Text="Bảng Báo Giá" Font-Bold="True" Font-Size="18px"></asp:TextBox>
                </div>
                <div class="ui-box">
                    <label class="labelpopup" style="width: 100px">Số báo giá </label>
                    <asp:TextBox ID="txtMaBaoGia" CssClass="textbox_child_text" runat="server" data-allow="add"></asp:TextBox>
                    &nbsp;&nbsp;
                <label class="labelpopup" style="width: 100px">Mã khách hàng</label>
                    <asp:DropDownList ID="drKhachHang" Style="width: 155px" CssClass="textbox_child_text" runat="server" AppendDataBoundItems="True" AutoPostBack="True" OnSelectedIndexChanged="drKhachHang_SelectedIndexChanged"></asp:DropDownList>
                    <a class="relationlink" onclick="return Show('');">...</a>
                    &nbsp;&nbsp;
                <label class="labelpopup" style="width: 120px">Tên khách hàng : </label>
                    <asp:TextBox ID="txtTenKhachHang" Style="width: 155px" CssClass="textbox_child_text" runat="server" Enabled="False"></asp:TextBox>
                </div>
                <div class="ui-box">
                    <label class="labelpopup" style="width: 100px">Thời gian : </label>
                    <asp:TextBox ID="txtThoiGian" CssClass="textbox_child_text_ngay" runat="server"></asp:TextBox>
                    <label class="labelpopup" style="width: 99px">Địa chỉ : </label>
                    <asp:TextBox ID="txtDiaChi" Style="width: 483px" CssClass="textbox_child_text" runat="server"></asp:TextBox>
                </div>
                <div class="ui-box">
                    <label class="labelpopup" style="width: 100px">Ông / Bà : </label>
                    <asp:TextBox ID="txtLienhe" CssClass="textbox_child_text" runat="server" Enabled="False"></asp:TextBox>
                    &nbsp;&nbsp;
                <label class="labelpopup" style="width: 100px">Chức vụ : </label>
                    <asp:TextBox ID="txtChucVu" CssClass="textbox_child_text" runat="server" Enabled="False"></asp:TextBox>
                    &nbsp;&nbsp;
                <%--<label class="labelpopup" style="width: 120px">Mã số thuế : </label>
                <asp:TextBox ID="txtMaSoThue" Style="width: 155px" CssClass="textbox_child_text" runat="server"></asp:TextBox>--%>
                </div>
                <div class="ui-box">
                    <asp:TextBox ID="txtNoiDung" TextMode="MultiLine" Style="text-align: center; height: 30px; width: 907px;" CssClass="textbox-muiti" runat="server" Text="Công ty ... xin trân trọng gửi đến Quý khách bảng báo giá Thiết bị như sau :"></asp:TextBox>
                </div>
                <div class="table-responsive">
                    <asp:ListView ID="ListViewProductQuotes" runat="server" DataKeyNames="Quotes_Materials_ID" OnItemCommand="ListViewProductQuotes_ItemCommand" OnItemDeleting="ListViewProductQuotes_ItemDeleting" OnItemEditing="ListViewProductQuotes_ItemEditing" OnItemUpdating="ListViewProductQuotes_ItemUpdating" OnItemCanceling="ListViewProductQuotes_ItemCanceling">
                        <LayoutTemplate>
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
                                        <th style="text-align: center" data-sorter="false" data-filter="false">Mã hàng</th>
                                        <th style="text-align: center" data-sorter="false" data-filter="false">Tên hàng</th>
                                        <th style="text-align: center" data-sorter="false" data-filter="false">Đơn vị tính</th>
                                        <th style="text-align: center" data-sorter="false" data-filter="false">Số lượng</th>
                                        <th style="text-align: center" data-sorter="false" data-filter="false">Đơn giá</th>
                                        <th style="text-align: center" data-sorter="false" data-filter="false">% VAT</th>
                                        <th style="text-align: center" data-sorter="false" data-filter="false">VAT</th>
                                        <th style="text-align: center" data-sorter="false" data-filter="false">Thành tiền</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr id="itemPlaceholder" runat="server">
                                    </tr>
                                </tbody>
                            </table>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <tr runat="server" class="warning browdelete" ondblclick="EditRows($(this))">
                                <td style="text-align: center; display: none;">
                                    <asp:Label ID="lbID" runat="server" Visible="false" Text='<%# Eval("Quotes_Materials_ID") %>' /></td>
                                <td style="text-align: center"><%# Eval("Materials_Alias") %></td>
                                <td style="text-align: center"><%# Eval("Materials_Name") %></td>
                                <td style="text-align: center"><%# Eval("Unit_Name") %></td>
                                <td style="text-align: center"><%# Eval("Quotes_Product_Quantity") %></td>
                                <td style="text-align: center"><%# Eval("Quotes_Product_Price") %></td>
                                <td style="text-align: center"><%# Eval("Quotes_Product_VAT_Percent") %></td>
                                <td style="text-align: center"><%# Eval("Quotes_Product_VAT") %></td>
                                <td style="text-align: center">
                                    <span class="delete">
                                        <asp:LinkButton ID="DeleteButton" CssClass="btn btn-default btn-xs fa fa-trash" runat="server" CommandName="Delete" /></span>
                                    <%# Eval("Quotes_Product_TotalCash") %>
                                </td>
                                <td style="text-align: center; display: none;">
                                    <asp:Button ID="EditButton" CssClass="btn btn-default btn-sm btn-xs editclick" runat="server" CommandName="Edit" Text="Thay đổi" />
                                </td>
                            </tr>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <tr class="warning browdelete">
                                <td>
                                    <asp:Label ID="lbID" runat="server" Visible="false" Text='<%# Eval("Quotes_Materials_ID") %>' />
                                    <asp:Label ID="lbMaVatTu" runat="server" Text='<%# Eval("Materials_Alias") %>' />
                                </td>

                                <td>
                                    <asp:Label ID="lbVatTu" runat="server" Text='<%# Eval("Materials_Name") %>' />
                                    <asp:Label ID="lbIDVatTu" runat="server" Visible="false" Text='<%# Eval("Materials_ID") %>' />
                                </td>

                                <td>
                                    <asp:Label ID="lbDVT" runat="server" Text='<%# Eval("Unit_Name") %>' />
                                </td>

                                <td style="text-align: center">
                                    <asp:TextBox ID="txtSoLuong" ClientIDMode="Static" onkeydown="txtOnKeyPress();" onKeyUp="txtOnKeyPress();" onkeypress="return ValidateKeypress(/\d/,event);" CssClass="txtsoluong text-num text-num-order note test" title="Chọn vào mẫu tin trên dòng để cập nhật số lượng,đơn giá,CK,VAT.Để lưu lại mẫu tin ấn [Alt + S].Huỷ mẫu tin ấn [Alt + A].Xoá mẫu tin trên dòng ấn [Alt + Q]" runat="server" Text="1" />
                                </td>

                                <td style="text-align: center">
                                    <asp:TextBox ID="txtDonGia" ClientIDMode="Static" onkeydown="txtOnKeyPress();" onkeyup="this.value=FormatNumber(this.value);txtOnKeyPress();" CssClass="txtdongia text-num text-num-order-1 note" title="Chọn vào mẫu tin trên dòng để cập nhật số lượng,đơn giá,CK,VAT.Để lưu lại mẫu tin ấn [Alt + S].Huỷ mẫu tin ấn [Alt + A].Xoá mẫu tin trên dòng ấn [Alt + Q]" runat="server" Text="0" />
                                </td>

                                <td style="text-align: center">
                                    <asp:TextBox ID="txtVATPercent" ClientIDMode="Static" onkeydown="txtOnKeyPress();" onKeyUp="txtOnKeyPress();" onkeypress="return ValidateKeypress(/\d/,event);" CssClass="txtvatpercent text-num text-num-order-1 note" title="Chọn vào mẫu tin trên dòng để cập nhật số lượng,đơn giá,CK,VAT.Để lưu lại mẫu tin ấn [Alt + S].Huỷ mẫu tin ấn [Alt + A].Xoá mẫu tin trên dòng ấn [Alt + Q]" runat="server" Text="0" />
                                </td>

                                <td style="text-align: center">
                                    <asp:TextBox ID="txtVAT" ClientIDMode="Static" ReadOnly="true" onkeypress="return ValidateKeypress(/\d/,event);" CssClass="txtvat text-num text-num-order-1 note" title="Chọn vào mẫu tin trên dòng để cập nhật số lượng,đơn giá,CK,VAT.Để lưu lại mẫu tin ấn [Alt + A].Huỷ mẫu tin ấn [Alt + Q].Xoá mẫu tin trên dòng ấn [Alt + Q]" runat="server" Text='0' />
                                </td>

                                <td style="text-align: center">
                                    <span class="delete">
                                        <asp:LinkButton ID="UpdateButton" AccessKey="s" CssClass="btn btn-default btn-xs fa fa-pencil" runat="server" CommandName="Update"></asp:LinkButton>
                                        <asp:LinkButton ID="CancelButton" AccessKey="a" CssClass="btn btn-default btn-xs fa fa-mail-reply" runat="server" CommandName="Cancel"></asp:LinkButton></span>
                                    <asp:TextBox ID="txtThanhTien" ClientIDMode="Static" ReadOnly="true" CssClass="txtthanhtien text-num text-num-order-1 note" title="Chọn vào mẫu tin trên dòng để cập nhật số lượng,đơn giá,CK,VAT.Để lưu lại mẫu tin ấn [Alt + S].Huỷ mẫu tin ấn [Alt + A].Xoá mẫu tin trên dòng ấn [Alt + Q]" runat="server" Text="0" />
                                </td>
                            </tr>
                        </EditItemTemplate>
                        <EmptyDataTemplate>
                            <div class='alert alert-danger'>
                                <a href='#' class='close' data-dismiss='alert'>&times;</a>
                                Vui lòng thêm sản phẩm báo giá !
                            </div>
                        </EmptyDataTemplate>
                    </asp:ListView>
                    <script type="text/javascript">
                        function txtOnKeyPress() {

                            var txtSoLuong = document.getElementById('txtSoLuong');
                            var txtDonGia = document.getElementById('txtDonGia');
                            var txtVATPercent = document.getElementById('txtVATPercent');
                            var txtVAT = document.getElementById('txtVAT');
                            var txtThanhTien = document.getElementById('txtThanhTien');

                            if (txtSoLuong != 'undefined' && txtDonGia != 'undefined'
                                && txtVATPercent != 'undefined' && txtVAT != 'undefined'
                                && txtThanhTien != 'undefined') {

                                if (txtSoLuong.value == '') {
                                    txtSoLuong.value = 0;
                                    return false;
                                }
                                if (txtDonGia.value == '') {
                                    txtDonGia.value = 0;
                                    return false;
                                }

                                txtVAT.value = (parseFloat(txtSoLuong.value) * parseFloat(txtDonGia.value.replace(",", "")) * (txtVATPercent.value)) / 100;

                                txtThanhTien.value = (parseFloat(txtSoLuong.value) * parseFloat(txtDonGia.value.replace(",", ""))) + parseFloat(txtVAT.value);
                            }
                        }
                    </script>
                </div>
                <div class="table-responsive">
                    <div style="width: 80%; float: left;">
                        <asp:ListView ID="ListViewProvision" runat="server" DataKeyNames="Quotes_Provision_ID" OnItemCanceling="ListViewProvision_ItemCanceling" OnItemCommand="ListViewProvision_ItemCommand" OnItemDeleting="ListViewProvision_ItemDeleting" OnItemEditing="ListViewProvision_ItemEditing" OnItemUpdating="ListViewProvision_ItemUpdating" InsertItemPosition="LastItem" OnItemInserting="ListViewProvision_ItemInserting">
                            <LayoutTemplate>
                                <table class="table table-bordered">
                                    <thead>
                                        <tr>
                                            <th style="text-align: center" data-sorter="false" data-filter="false">Điều khoản</th>
                                            <th style="text-align: center" data-sorter="false" data-filter="false">Nội dung</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </tbody>
                                </table>
                            </LayoutTemplate>
                            <ItemTemplate>
                                <tr runat="server" class="warning browdelete" ondblclick="EditRows($(this))">
                                    <td style="display: none;">
                                        <asp:Label ID="lbID" runat="server" Visible="false" Text='<%# Eval("Quotes_Provision_ID") %>' /></td>
                                    <td><%# Eval("Quotes_Provision_Name") %></td>
                                    <td>
                                        <span class="delete">
                                            <asp:LinkButton ID="DeleteButton" CssClass="btn btn-default btn-xs fa fa-trash" runat="server" CommandName="Delete" /></span>
                                        <%# Eval("Quotes_Provision_Value") %>
                                    </td>
                                    <td style="text-align: center; display: none;">
                                        <asp:Button ID="EditButton" CssClass="btn btn-default btn-sm btn-xs editclick" runat="server" CommandName="Edit" Text="Thay đổi" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <tr class="warning browdelete">
                                    <td style="display: none;">
                                        <asp:Label ID="lbID" runat="server" Visible="false" Text='<%# Eval("Quotes_Provision_ID") %>' /></td>
                                    <td>
                                        <asp:TextBox ID="txtDieuKhoan" ClientIDMode="Static" Style="width: 160px;" runat="server" Text='<%# Eval("Quotes_Provision_Name") %>' /></td>
                                    <td>
                                        <span class="delete">
                                            <asp:LinkButton ID="UpdateButton" AccessKey="s" CssClass="btn btn-default btn-xs fa fa-pencil" runat="server" CommandName="Update"></asp:LinkButton>
                                            <asp:LinkButton ID="CancelButton" AccessKey="a" CssClass="btn btn-default btn-xs fa fa-mail-reply" runat="server" CommandName="Cancel"></asp:LinkButton></span>
                                        <asp:TextBox ID="txtNoiDungDieuKhoan" ClientIDMode="Static" TextMode="MultiLine" Style="width: 315px; height: 50px;" runat="server" Text='<%# Eval("Quotes_Provision_Value") %>' /></td>
                                </tr>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <tr class="warning">
                                    <td>
                                        <asp:TextBox ID="txtThemDieuKhoan" onchange="return InsertRows();" Style="width: 160px;" runat="server" Text='' /></td>
                                    <td>
                                        <asp:TextBox ID="txtThemNoiDungDieuKhoan" onchange="return InsertRows();" TextMode="MultiLine" Style="width: 315px; height: 24px;" runat="server" Text='' /></td>
                                    <td style="text-align: center; display: none;">
                                        <asp:Button ID="UpdateButtonThem" AccessKey="s" CssClass="btn btn-default btn-xs insertclick" runat="server" CommandName="Insert" Text="Cập nhật" />
                                    </td>
                                </tr>
                            </InsertItemTemplate>
                        </asp:ListView>
                    </div>
                    <div style="width: 20%; float: right; text-align: right;">
                        Tổng tiền hàng:
                        <br />
                        <asp:TextBox ID="txtTongTienHang" CssClass="float" Enabled="false" runat="server" Text="0"></asp:TextBox><br />
                        Tổng tiền VAT:
                        <br />
                        <asp:TextBox ID="txtTongTienVAT" CssClass="float" Enabled="false" runat="server" Text="0"></asp:TextBox><br />
                        Phí vận chuyển:
                        <br />
                        <asp:TextBox ID="txtPhiVanChuyen" CssClass="float" runat="server" Text="0" AutoPostBack="true" OnTextChanged="txtPhiVanChuyen_TextChanged"></asp:TextBox><br />
                        Tổng cộng:
                        <br />
                        <asp:TextBox ID="txtTongCong" CssClass="float" Enabled="false" runat="server" Text="0"></asp:TextBox><br />
                        Loại tiền:
                        <br />
                        <asp:DropDownList runat="server" CssClass="float" ID="drLoaiTien" AppendDataBoundItems="true"></asp:DropDownList>
                    </div>
                </div>
                <div class="ui-box">
                    <asp:TextBox ID="txtLoiChao" TextMode="MultiLine" Style="text-align: center; height: 43px; width: 907px;" CssClass="textbox-muiti" runat="server" Text="Chúng tôi hy vọng bản chào giá này sẽ đáp ứng được nhu cầu của Quý Công ty và rất mong nhận được đơn đặt hàng sớm của Quý Công ty. Mọi thông tin cần thiết xin Quý Công ty liên hệ với chúng tôi theo địa chỉ trên."></asp:TextBox>
                </div>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSavePopup" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <div id="baogia_themsanpham" title="Thêm sản phẩm báo giá">
    <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
        <ContentTemplate>
            <asp:LinkButton ID="btnSavePopupQuotes" data-placement="bottom" class="btn btn-default btn-sm" title="Lưu lại" runat="server" OnClientClick="return confirmCheckInAdd(this)" OnClick="btnSavePopupQuotes_Click"><span class="glyphicon glyphicon-floppy-disk"></span> Lưu lại</asp:LinkButton>
            <asp:UpdateProgress ID="upDateProcess1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
                <ProgressTemplate>
                    <span style="text-align: center" class="label label-warning">Đang tải...</span>
                </ProgressTemplate>
            </asp:UpdateProgress>
            <div class="table-responsive">
                <asp:ListView ID="ListViewQuotesProduct" runat="server" DataKeyNames="Materials_Id">
                    <LayoutTemplate>
                        <table id="MyTableQuotesProduct" class="tablesorter">
                            <thead>
                                <tr>
                                    <th style="text-align: center" data-sorter="false" data-filter="false">STT</th>
                                    <th style="text-align: center" data-sorter="false" data-filter="false">
                                        <input type="checkbox" onchange="checkAllQuotes()" id="chkAllQuotes" />
                                    </th>
                                    <th style="text-align: center" class="filter-select" data-placeholder="--Chọn mã vật tư--">Mã vật tư</th>
                                    <th style="text-align: center" class="filter-select" data-placeholder="--Chọn tên vật tư--">Tên vật tư</th>
                                    <th style="text-align: center" class="filter-select" data-placeholder="--Chọn thể tích vật tư--">Thể tích vật tư</th>
                                    <th style="text-align: center" class="filter-select" data-placeholder="--Chọn tên nhóm vật tư--">Tên nhóm vật tư</th>
                                    <th style="text-align: center" class="filter-select" data-placeholder="--Chọn đơn vị tính--">Đơn vị tính</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr id="itemPlaceholder" runat="server">
                                </tr>
                            </tbody>
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <tr runat="server" class="warning">
                            <td style="text-align: center"><%# Eval("Materials_Id") %></td>
                            <td style="text-align: center">
                                <asp:CheckBox ClientIDMode="Static" ID="chkListQuotes" runat="server" />
                            </td>
                            <td><%# Eval("Materials_Alias") %></td>
                            <td><%# Eval("Materials_Name") %></td>
                            <td><%# Eval("Materials_Tankage") %></td>
                            <td><%# Eval("Materials_Type_Name") %></td>
                            <td><%# Eval("Unit_Name") %></td>
                        </tr>
                    </ItemTemplate>
                    <EmptyDataTemplate>
                        <div class='alert alert-danger'>
                            <a href='#' class='close' data-dismiss='alert'>&times;</a>
                            Không tìm thấy mẫu tin nào !
                        </div>

                    </EmptyDataTemplate>
                </asp:ListView>
                <div style="position: absolute; text-align: center; width:90%;" class="pager pagerMyTableQuotesProduct">
                    <span>Trang</span>
                    <select class="gotoPage" title="Select page number"></select>
                    <img src="../Content/TableSort/addons/pager/icons/first.png" class="first" alt="First" />
                    <img src="../Content/TableSort/addons/pager/icons/prev.png" class="prev" alt="Prev" />
                    <span class="pagedisplay"></span>
                    <img src="../Content/TableSort/addons/pager/icons/next.png" class="next" alt="Next" />
                    <img src="../Content/TableSort/addons/pager/icons/last.png" class="last" alt="Last" />
                </div>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSavePopupQuotes" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</div>
</div>
<!--------------Kêt-thúc----------------->
